package com.bwie.record.service.impl;

import com.bwie.record.domain.DataOne;
import com.bwie.record.mapper.DataOneMapper;
import com.bwie.record.service.DataOneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName DataOneServiceImpl
 * @Description 描述
 * @Author ZiZheng.Li
 * @Date 2024/7/7 16:34
 */
@Service
public class DataOneServiceImpl implements DataOneService {
    @Autowired
    private DataOneMapper dataOneMapper;

    @Override
    public int addDataOne(DataOne dataOne) {
        return dataOneMapper.insert(dataOne);
    }

    @Override
    public int updateDataOne(DataOne dataOne) {
        return dataOneMapper.update(dataOne);
    }

    @Override
    public DataOne getDataOneById(String id) {
        return dataOneMapper.findById(id);
    }

    @Override
    public List<DataOne> findAll() {
        return dataOneMapper.findAll();
    }

    @Override
    public List<DataOne> findByTimestampGreaterThanEqualOrderByTimestampAsc(String lastTime) {
        return dataOneMapper.findByTimestampGreaterThanEqualOrderByTimestampAsc(lastTime);
    }
}
